package thread;

public class Demo5 {
    public static void main(String[] args) throws InterruptedException {
        Thread t1 = new Thread((Runnable) () -> {
            while (true) {
                System.out.println("Hello Thread");
                try {
                    Thread.sleep(100);
                } catch (InterruptedException e) {
                    throw new RuntimeException(e);
                }
            }
        });
        t1.start();
        while (true) {
            System.out.println("Hello Main");
            Thread.sleep(100);
        }
    }
}
